home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mastering Web Site Development
/
Microsoft Mastering Web Site Development (Microsoft) (1997).iso
/
Media
/
Ch03
/
W03D100.CC2
< prev
Wrap
Text File
|
1997-04-24
|
2KB
|
42 lines
0, In this demonstration, you will see how to use a
4, parameter query with the data range design-time
8, controls. I'll use the design-time controls to
12, create an application that enables a user to enter a
17, MajorID and returns a list of classes for that
21, major. The first step is to create an HTML form in
26, which the user can enter the MajorID requested. I've
31, created an HTML page ClassesInMajor and in this
35, page I've defined a form that contains an input field
41, in which the user can provide a MajorID, and a
45, Submit button the user clicks to submit the form.
50, When the form is submitted, the .asp file
54, GetClassesInMajor is activated. Let's look at that .asp file
59, now. The first step in this file is to save the
67, value provided by the user on the form into the
71, variable MajorID. This variable will be used by the
77, data range controls. Next, I'll insert the Data
81, Range Header control. I'll select a valid data
89, connection and click SQL Builder to generate the SQL
94, statement. I'll add the classes table and select the
99, fields: Title and MajorID. In the Criteria column
105, for the MajorID field, I'll enter the value
108, [MajorID] in square brackets. The square brackets indicate
117, that this is a variable. The data range control
120, will find all classes where the MajorID is equal to
125, the value of the variable MajorID in my .asp
129, file. I'll close the Query Builder and update the
135, Data Range Header control. Next, I'll enter the code
145, to display the data retrieved by the data range
148, control. Finally, I'll enter the Data Range Footer
156, control. I'll accept the default properties and
165, save the control. Now let's save the file and preview
173, in the browser. I'll preview the file
180, ClassesInMajor.htm. This is the HTML form in which I provide a
187, MajorID. When I click Submit, the .asp file runs and
193, returns a list of classes for that major. If I
200, return to the HTML form, I can provide a different
204, MajorID and a different set of classes is
207, displayed. So in this demonstration, you have seen how to
212, use a parameter query with the data range
218, design-time controls.
219, END